﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<!-- #include file="fckeditor.asp" -->
<%
checkadmin(4)
dim parent_id,parent_path,parent_pathname,parent_level,rsp,sqlp,parent_fenlei,thefenlei, template_pre,url,recordtemplate_pre,perpage
thefenlei=GetIntQueryString("thefenlei")
parent_id=GetIntQueryString("parentid")
perpage=20
if (parent_id=0) Then 
	parent_path="0,"
	parent_pathname="首页,"
	parent_level=1
else
	Set rsp = Server.CreateObject("ADODB.Recordset")
	sqlp = "select * from [c_type] where id="&parent_id
	rsp.open sqlp,conn,1,1
	If Not rsp.eof Then 
	parent_id=rsp("id")
	parent_path=rsp("path")
	parent_level=rsp("thelevel")
	parent_fenlei=rsp("fenlei")
	perpage=rsp("perpage")
	url=rsp("url")
	thefenlei=parent_fenlei
	End If 
	rsp.close
	Set rsp=Nothing 
End If 
Dim ftype
Select Case thefenlei
	Case 1:
		template_pre="articlelist"
		recordtemplate_pre="articleshow"
		ftype="文章资讯"
	Case 2:
		template_pre="productlist"
		recordtemplate_pre="productshow"
		ftype="商品资讯"
	Case 3:
		template_pre="photolist"
		recordtemplate_pre="photoshow"
		ftype="图片资讯"
	Case 5:
		template_pre="guestbooklist"
		recordtemplate_pre="guestbookshow"
		ftype="留言本"
	Case 6:
		ftype="单页分类"
		template_pre="typeshow"
	Case 7:
		ftype="招聘信息"
		template_pre="joblist"
		recordtemplate_pre="jobshow"
	Case 4:
		ftype="外部链接"
		template_pre=""
End Select 
Dim outlink
outlink=Trim(request.querystring("outlink"))
If outlink="1" Then 
thefenlei=4
ftype=ftype&"&gt;&gt;外部链接"
template_pre=""
parent_fenlei=4
ElseIf outlink="2" Then 
thefenlei=6
ftype=ftype&"&gt;&gt;单页分类"
template_pre="typeshow"
parent_fenlei=6
End If 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
<script type="text/javascript" src="admin_js/common.js"></script>
<title>添加分类</title>
</head>
<body>
<form name="rzform" method="post" action="type_save.asp">
<table class="table_800" cellspacing="0" cellpadding="0">
<input type="hidden" id="act" name="act" value="addsave"/>	
<input type="hidden" id="parent_id" name="parent_id" value="<%=parent_id%>"/>	
<input type="hidden" id="parent_path" name="parent_path" value="<%=parent_path%>"/>	
<input type="hidden" id="parent_pathname" name="parent_pathname" value="<%=parent_pathname%>"/>	
<input type="hidden" id="parent_level" name="parent_level" value="<%=parent_level%>"/>	
<tr>
	<th colspan="2">添加分类：<%=ftype%></th>
</tr>
<tr class="row">
	<td>分类名称</td>
	<td><input type="text" name="name" id="name" size="20"/>名称请不要带半角逗号（,）</td>
</tr>
<tr class="row">
	<td>Class Name</td>
	<td><input type="text" name="engname" id="engname" size="20"/>名称请不要带半角逗号（,）</td>
</tr>
<tr class="row">
	<td>关键字</td>
	<td><input type="text" name="keyword_chn" id="keyword_chn" size="30" maxlength="100"/>使用空格分隔</td>
</tr>
<tr class="row">
	<td>Keyword</td>
	<td><input type="text" name="keyword_eng" id="keyword_eng" size="30" maxlength="100"/>使用空格分隔</td>
</tr>
<tr class="row">
	<td>排序</td>
	<td><input type="text" name="theorder" id="theorder" size="2" value="0" onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')" value="20"/>（阿拉伯数字）</td>
</tr>
<%If thefenlei<>4 And thefenlei<>6 Then %>
<tr class="row">
	<td>每页记录数</td>
	<td><input type="text" name="perpage" id="perpage" size="2" value="<%=perpage%>" onkeyup="this.value=this.value.replace(/[^\d]+?/g,'')"/><span style="color:red;">主列表页面请使用pagesize="x"来获取此参数值</span></td>
</tr>
<%End If %>
<tr class="row">
	<td>是否显示</td>
	<td><input type="checkbox" id="visible" name="visible" value="1" checked="true"/>（如果不选中，则不会显示本分类）</td>
</tr>
<%If template_pre<>""  Then %>
<tr class="row">
	<td>栏目模板</td>
	<td>
	<select name="template" id="template">
	<%=ReadTemplateList(template_pre,"")%>
	</select><a href="manage_template.asp" onclick="alert('注意文件名要使用<%=template_pre%>_开头');">新建模板</a>
	</td>
</tr>
<%End If %>
<%If template_pre<>""  Then %>
<tr class="row">
	<td>明细记录模板</td>
	<td>
	<select name="recordtemplate" id="recordtemplate">
	<%=ReadTemplateList(recordtemplate_pre,"")%>
	<option value="">不需要明细记录</option>
	</select><a href="manage_template.asp" onclick="alert('注意文件名要使用<%=recordtemplate_pre%>_开头');">新建模板</a>
	</td>
</tr>
<%End If %>
<%if parent_id>0 then%>
<input type="hidden" id="fenlei" name="fenlei" value="<%=parent_fenlei%>">
<%else%>
<input type="hidden" id="fenlei" name="fenlei" value="<%=thefenlei%>">
<%End If %>
<%if thefenlei=4 then%>
<tr  class="row">
	<td>前台链接网址</td>
	<td><input type="text" id="url" name="url" size="30" value="<%=url%>"/></td>
</tr>
<%End If %>
<tr class="row">
<td>分类图片</td>
<td>
<input type="text" name="typeimg"  style="background-color:#CCCCCC;" id="typeimg" size="30"/><input type="button" name="copyimg" value="从已上传的图片中选择" onclick="openWin('selectphoto.asp?photobox=typeimg',840,500);"/><br/>
<iframe  marginwidth="0" marginheight="0" frameborder="0" style="width:400px;height:30px" src="rzupload.asp?parentform=rzform&inputname=typeimg" scrolling="no"></iframe>
</td>
</tr>
<%If thefenlei=1 Or thefenlei=2 Or thefenlei=3 Or thefenlei=6 Or thefenlei=9 Then %>
<tr class="row">
	<td>中文内容</td>
	<td>
<%
Dim sBasePath
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left( sBasePath, InStrRev( sBasePath, "/" ) )

Dim oFCKeditor
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Config("ImageBrowser") = "true" 
oFCKeditor.Value	= ""
oFCKeditor.Create "content_chn"
%>
	</td>
</tr>
<tr class="row">
	<td>英文内容</td>
	<td>
<%
Set oFCKeditor = New FCKeditor
oFCKeditor.BasePath	= sBasePath
oFCKeditor.Config("ImageBrowser") = "true" 
oFCKeditor.Value	= ""
oFCKeditor.Create "content_eng"
%>
	</td>
</tr>
<%End If %>
<tr class="row">
	<td colspan="2" class="tdcenter"><input type="button" class="btn" value="保存" onclick="checkForm('addtype');"/>&nbsp;&nbsp;<input type="reset" class="btn" value="重置"/>&nbsp;&nbsp;<input type="button" class="btn"  value="返回" onclick="javascript:location.href='type_list.asp'"/></td>
</tr> 
</table>
</form>
</body>
</html>